package com.ccrfid.rmc6.ws.c5.videosync;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.oxm.jaxb.Jaxb2Marshaller;

@Configuration
public class VideoSyncConfiguration {
    @Bean
    public Jaxb2Marshaller marshaller() {
        Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
//        marshaller.setContextPath("com.ccrfid.rmc6.ws.c5.videosync.pojo");
        marshaller.setContextPaths("com.ccrfid.rmc6.ws.c5.cardreader.pojo", "com.ccrfid.rmc6.ws.c5.videosync.pojo");
        return marshaller;
    }

    @Bean
    public VideoSyncClient videoSyncClient(Jaxb2Marshaller marshaller) {
        VideoSyncClient client = new VideoSyncClient();
        client.setDefaultUri("http://localhost:8085");
        client.setMarshaller(marshaller);
        client.setUnmarshaller(marshaller);
        return client;
    }
}
